home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / misc / ispell-3.001 / ispell-3~ / ispell-3.1 / Makefile < prev    next >
Makefile  |  1995-10-12  |  19KB  |  596 lines

  1. #
  2. # $Id: Makefile,v 1.102 1995/10/11 04:30:25 geoff Exp $
  3. #
  4. # Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
  5. # All rights reserved.
  6. #
  7. # Redistribution and use in source and binary forms, with or without
  8. # modification, are permitted provided that the following conditions
  9. # are met:
  10. #
  11. # 1. Redistributions of source code must retain the above copyright
  12. #    notice, this list of conditions and the following disclaimer.
  13. # 2. Redistributions in binary form must reproduce the above copyright
  14. #    notice, this list of conditions and the following disclaimer in the
  15. #    documentation and/or other materials provided with the distribution.
  16. # 3. All modifications to the source code must be clearly marked as
  17. #    such.  Binary redistributions based on modified source code
  18. #    must be clearly marked as modified versions in the documentation
  19. #    and/or other materials provided with the distribution.
  20. # 4. All advertising materials mentioning features or use of this software
  21. #    must display the following acknowledgment:
  22. #      This product includes software developed by Geoff Kuenning and
  23. #      other unpaid contributors.
  24. # 5. The name of Geoff Kuenning may not be used to endorse or promote
  25. #    products derived from this software without specific prior
  26. #    written permission.
  27. #
  28. # THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
  29. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  30. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  31. # ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
  32. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  33. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  34. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  36. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  37. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  38. # SUCH DAMAGE.
  39. #
  40. # You will have to create a local.h file before building; look over
  41. # config.X to learn what things you may need to define, or use one of
  42. # the sample local.h files shipped.
  43. #
  44. # the argument syntax for buildhash to make alternate dictionary files
  45. # is simply:
  46. #
  47. #   buildhash <dictfile> <affix-file> <outfile>
  48.  
  49. # $Log: Makefile,v $
  50. # Revision 1.102  1995/10/11  04:30:25  geoff
  51. # Allow DEFHASH and MASTERHASH to be the same.
  52. #
  53. # Revision 1.101  1995/08/05  23:19:33  geoff
  54. # Add the showversion target to ease the job of debugging people's make
  55. # output.  Make sure SHELLDEBUG is set for the entire process of making
  56. # config.sh.
  57. #
  58. # Revision 1.100  1995/03/06  02:42:39  geoff
  59. # Run iwhich explicitly from the shell, so that we don't have to worry
  60. # about PATH problems and whether it's executable or not.  Also fix a
  61. # place where -nw was not removed from the batch emacs switch list.
  62. #
  63. # Revision 1.99  1995/01/08  23:23:23  geoff
  64. # Get rid of an obsolete etags flag.  Add some new variables to config.sh.
  65. #
  66. # Revision 1.98  1994/12/27  23:08:43  geoff
  67. # Use the new "iwhich" script to decide whether to install emacs-related
  68. # stuff.  Make correct.o depend on version.h so that "ispell -a" always
  69. # reports the correct version.
  70. #
  71. # Revision 1.97  1994/11/21  07:02:51  geoff
  72. # Specify default values for the BUILD macros, so that some systems
  73. # don't accidentally override them and make ispell think that the
  74. # dictionaries are missing.
  75. #
  76. # Revision 1.96  1994/10/25  05:45:54  geoff
  77. # Make the installation command configurable.
  78. #
  79. # Revision 1.95  1994/10/18  04:03:17  geoff
  80. # Get rid of DICTVARIANTS, which is obsolete.  Compile term.o first, so
  81. # that errors in it (which are common) will show up first.  Improve the
  82. # rules for generation of msgs.h.
  83. #
  84. # Revision 1.94  1994/09/16  05:06:55  geoff
  85. # Split installation up into basic and dictionary-building tools, so
  86. # that we can have a partial-install target.
  87. #
  88. # Revision 1.93  1994/09/16  04:51:28  geoff
  89. # Handle installations that have ELISPDIR but not TEXINFODIR
  90. #
  91. # Revision 1.92  1994/09/16  02:45:52  geoff
  92. # Don't strip non-binaries.  Fix an accidentally-doubled backslash.
  93. #
  94. # Revision 1.91  1994/08/31  05:58:27  geoff
  95. # Strip binaries before installing them.  Create directories before
  96. # installing into them.  Make sure manual pages are installed with the
  97. # correct protection modes.
  98. #
  99. # Revision 1.90  1994/05/25  04:29:16  geoff
  100. # Don't remove english.4 after the English makefile has carefully
  101. # installed it.
  102. #
  103. # Revision 1.89  1994/05/24  05:31:22  geoff
  104. # Return to the old sed-based method of parsing LANGUAGES, so that things
  105. # will work on broken systems like BSDI.
  106. #
  107. # Revision 1.88  1994/05/24  04:54:30  geoff
  108. # Fix the emacs installation to use emacs batch mode properly, so that a
  109. # terminal isn't required.
  110. #
  111. # Revision 1.87  1994/03/21  01:55:17  geoff
  112. # If a hard link can't be made to msgs.h, copy it instead
  113. #
  114. # Revision 1.86  1994/02/22  06:09:03  geoff
  115. # Add SHELLDEBUG.  Change the language-subdirs target to use the shell
  116. # IFS variable to parse things, simplifying things and improving
  117. # efficiency (thanks to Hagen Ross for the idea and implemenation).
  118. #
  119. # Revision 1.85  1994/02/13  23:25:31  geoff
  120. # Fix multiple-language processing to not pass subsequent specifications to
  121. # the first Makefile.  Also fix the language shell loop to be more flexible.
  122. #
  123. # Revision 1.84  1994/02/07  08:10:40  geoff
  124. # When processing the LANGUAGES configuration variable (from local.h),
  125. # use sed instead of expr to process it.  This gets around versions of
  126. # expr that have 127-character limitations (though it probably still
  127. # limits us to 512 characters with some versions of sed, so further work
  128. # may be needed here).
  129. #
  130. # Revision 1.83  1994/02/07  06:31:20  geoff
  131. # Clarify how to change variables in local.h
  132. #
  133. # Revision 1.82  1994/02/07  06:29:31  geoff
  134. # Add a dummy else clause to shell if-test for Ultrix
  135. #
  136. # Revision 1.81  1994/02/07  05:35:34  geoff
  137. # Make realclean run dictclean
  138. #
  139. # Revision 1.80  1994/01/26  07:44:43  geoff
  140. # Make yacc configurable through local.h.
  141. #
  142. # Revision 1.79  1994/01/25  07:11:11  geoff
  143. # Get rid of all old RCS log lines in preparation for the 3.1 release.
  144. #
  145. #
  146.  
  147. #
  148. # !!!DO NOT EDIT HERE!!!
  149. #
  150. # Unlike previous versions of ispell, there should be no need to edit
  151. # your Makefile.  Instead, #define the corresponding variables in your
  152. # local.h file; the Makefile will automatically pick them up.  The
  153. # only reason you should need to edit the Makefile might to be to add
  154. # non-English dictionary support.
  155. #
  156. # For example, if you want to set CFLAGS to "-g -Wall", don't put it
  157. # here.  Put:
  158. #
  159. #    #define CFLAGS    "-g -Wall"
  160. #
  161. # in local.h.  Otherwise, it won't have any effect.
  162. #
  163. EXTRADICT = Use_config.sh
  164.  
  165. SHELL = /bin/sh
  166. MAKE = make
  167.  
  168. #
  169. #    Set this to "-vx" in the make command line if you need to
  170. #    debug the complex shell commands.
  171. #
  172. SHELLDEBUG = +vx
  173.  
  174. all:    unpacked
  175. all:    config.sh
  176. all:    programs showversion ispell.1 ispell.info
  177. all:    all-languages
  178.  
  179. programs: buildhash findaffix tryaffix ispell
  180. programs: icombine ijoin munchlist
  181. programs: subset sq unsq zapdups
  182.  
  183. showversion:
  184.     ./ispell -v | head -1
  185.  
  186. .c.o:
  187.     @. ./config.sh; \
  188.       set -x; \
  189.       $$CC $$CFLAGS -c $<
  190.  
  191. .y.o:
  192.     @. ./config.sh; \
  193.       set -x; \
  194.       $$YACC $<; \
  195.       $$CC $$CFLAGS -c y.tab.c; \
  196.       mv y.tab.o $@; \
  197.       rm -f y.tab.c
  198.  
  199. all-languages:    munchable
  200.     $(MAKE) LANGUAGE_TARGET=all SHELLDEBUG=$(SHELLDEBUG) language-subdirs
  201.  
  202. install: config.sh all install-basic install-dictbuild install-languages
  203.  
  204. partial-install: config.sh all install-basic install-languages
  205.  
  206. install-basic:
  207.     @. ./config.sh; \
  208.       set -x; \
  209.       [ -d $$BINDIR ]  ||  (mkdir $$BINDIR; chmod 755 $$BINDIR); \
  210.       cd $$BINDIR; \
  211.       rm -f ispell
  212.     @. ./config.sh; \
  213.       set -x; \
  214.       $$INSTALL ispell $$BINDIR
  215.     @. ./config.sh; \
  216.       set -x; \
  217.       cd $$BINDIR; \
  218.       strip ispell; \
  219.       chmod 755 ispell
  220.     @. ./config.sh; \
  221.       set -x; \
  222.       [ -d $$MAN1DIR ]  ||  (mkdir $$MAN1DIR; chmod 755 $$MAN1DIR); \
  223.       [ -d $$MAN4DIR ]  ||  (mkdir $$MAN4DIR; chmod 755 $$MAN4DIR); \
  224.       cd $$MAN1DIR; \
  225.         rm -f ispell$$MAN1EXT; \
  226.       cd $$MAN4DIR; \
  227.         rm -f ispell$$MAN4EXT
  228.     @. ./config.sh; \
  229.       set -x; \
  230.       $$INSTALL ispell.1 $$MAN1DIR/ispell$$MAN1EXT; \
  231.       $$INSTALL ispell.4 $$MAN4DIR/ispell$$MAN4EXT
  232.     @. ./config.sh; \
  233.       set -x; \
  234.       cd $$MAN1DIR; \
  235.       chmod 644 ispell$$MAN1EXT; \
  236.       cd $$MAN4DIR; \
  237.       chmod 644 ispell$$MAN4EXT
  238.     @set +e; \
  239.       . ./config.sh; \
  240.       set $(SHELLDEBUG); \
  241.       if [ -d $$TEXINFODIR -a -r ispell.info ]; then \
  242.         set -ex; \
  243.         rm -f $$TEXINFODIR/ispell; \
  244.         $$INSTALL ispell.info $$TEXINFODIR/ispell; \
  245.         chmod 644 $$TEXINFODIR/ispell; \
  246.       else \
  247.         : ; \
  248.       fi
  249.     @set +e; \
  250.       . ./config.sh; \
  251.       set $(SHELLDEBUG); \
  252.       if [ -d $$ELISPDIR ]; then \
  253.         set -ex; \
  254.         rm -f $$ELISPDIR/ispell.el; \
  255.         $$INSTALL ispell.el $$ELISPDIR; \
  256.         if sh iwhich $$EMACS >/dev/null; then \
  257.         echo '(byte-compile-file "'"$$ELISPDIR/ispell.el"'")' \
  258.           > /tmp/emi$$$$; \
  259.         $$EMACS -batch -l /tmp/emi$$$$; \
  260.         rm -f /tmp/emi$$$$; \
  261.         chmod 644 $$ELISPDIR/ispell.el $$ELISPDIR/ispell.elc; \
  262.         else \
  263.         chmod 644 $$ELISPDIR/ispell.el; \
  264.         fi; \
  265.       else \
  266.         : ; \
  267.       fi
  268.  
  269. install-dictbuild:
  270.     @. ./config.sh; \
  271.       set -x; \
  272.       [ -d $$BINDIR ]  ||  (mkdir $$BINDIR; chmod 755 $$BINDIR); \
  273.       cd $$BINDIR; \
  274.       rm -f buildhash icombine ijoin \
  275.         munchlist findaffix tryaffix sq unsq; \
  276.       rm -f $$LIBDIR/icombine
  277.     @. ./config.sh; \
  278.       set -x; \
  279.       $$INSTALL buildhash icombine ijoin munchlist findaffix tryaffix \
  280.           sq unsq \
  281.         $$BINDIR
  282.     @. ./config.sh; \
  283.       set -x; \
  284.       cd $$BINDIR; \
  285.       strip buildhash icombine ijoin sq unsq; \
  286.       chmod 755 buildhash icombine ijoin \
  287.         munchlist findaffix tryaffix sq unsq
  288.     @. ./config.sh; \
  289.       set -x; \
  290.       [ -d $$MAN1DIR ]  ||  (mkdir $$MAN1DIR; chmod 755 $$MAN1DIR); \
  291.       [ -d $$MAN4DIR ]  ||  (mkdir $$MAN4DIR; chmod 755 $$MAN4DIR); \
  292.       cd $$MAN1DIR; \
  293.         rm -f sq$$MAN1EXT
  294.     @. ./config.sh; \
  295.       set -x; \
  296.       $$INSTALL sq.1 $$MAN1DIR/sq$$MAN1EXT; \
  297.       for m in buildhash munchlist findaffix tryaffix; do \
  298.         echo ".so `basename $$MAN1DIR`/ispell$$MAN1EXT" \
  299.           > $$MAN1DIR/$$m$$MAN1EXT; \
  300.       done; \
  301.       echo ".so `basename $$MAN1DIR`/sq$$MAN1EXT" \
  302.         > $$MAN1DIR/unsq$$MAN1EXT 
  303.     @. ./config.sh; \
  304.       set -x; \
  305.       cd $$MAN1DIR; \
  306.       chmod 644 sq$$MAN1EXT buildhash$$MAN1EXT \
  307.         munchlist$$MAN1EXT findaffix$$MAN1EXT tryaffix$$MAN1EXT
  308.  
  309. install-languages:
  310.     $(MAKE) LANGUAGE_TARGET=install SHELLDEBUG=$(SHELLDEBUG) \
  311.       language-subdirs
  312.     . ./config.sh; \
  313.       [ -d $$LIBDIR ]  ||  (mkdir $$LIBDIR; chmod 755 $$LIBDIR); \
  314.       set -x; \
  315.       cd $$LIBDIR; \
  316.       if [ $$MASTERHASH != $DEFHASH ]; then \
  317.         rm -f $$DEFHASH; \
  318.         ln $$MASTERHASH $$DEFHASH; \
  319.       fi
  320.  
  321. ispell.info:    config.sh ispell.texinfo
  322.     set +e; \
  323.       . ./config.sh; \
  324.       set $(SHELLDEBUG); \
  325.       if [ -d $$TEXINFODIR ]; then \
  326.         if sh iwhich makeinfo >/dev/null \
  327.           &&  makeinfo ispell.texinfo 2>/dev/null; then \
  328.         :; \
  329.         elif sh iwhich $$EMACS >/dev/null; then \
  330.         set -e; \
  331.         $$EMACS -batch dummy -i ispell.texinfo \
  332.           -f texinfo-format-buffer -f save-buffer; \
  333.         fi; \
  334.         rm -f ispell.info~; \
  335.       else \
  336.         : ; \
  337.       fi
  338.  
  339. munchable:    findaffix tryaffix munchlist buildhash ispell icombine
  340. munchable:    ijoin
  341. munchable:    sq unsq
  342.  
  343. #
  344. #    The following auxiliary dependency is used to make targets in
  345. #    the language directories.  Do you find it intimidating?  No
  346. #    surprise;  remember that this is by the guy who wrote munchlist.
  347. #
  348. LANGUAGE_TARGET    =   Do_not_try_to_make_this_target_yourself
  349. BUILD    =    build
  350. CBUILD    =    build
  351. DBUILD    =    build
  352.  
  353. language-subdirs:    config.sh
  354.     @. ./config.sh; \
  355.         set $(SHELLDEBUG); \
  356.         set +e; \
  357.         while [ "X$$LANGUAGES" != X ]; do \
  358.         ( \
  359.         descriptor=`echo "$$LANGUAGES" \
  360.           | sed 's/[^{]*{\([^}]*\)}.*/\1/'`; \
  361.         dir=`echo "$$descriptor" | sed 's/\([^,]*\).*/\1/'`; \
  362.         descriptor=`echo "$$descriptor" \
  363.           | sed 's/[^,]*,*\(.*\).*/\1/'`; \
  364.         makeargs=''; \
  365.         while [ "X$$descriptor" != X ]; \
  366.         do \
  367.             nextvar=`echo "$$descriptor" | sed 's/\([^,]*\).*/\1/'`; \
  368.             makeargs="$$makeargs '$$nextvar'"; \
  369.             descriptor=`echo "$$descriptor" \
  370.               | sed 's/[^,]*,*\(.*\).*/\1/'`; \
  371.         done; \
  372.         set -x; \
  373.         cd languages/$$dir; \
  374.         eval $(MAKE) BUILD=$(BUILD) DBUILD=$(DBUILD) CBUILD=$(CBUILD) \
  375.           SHELLDEBUG=$(SHELLDEBUG) "$$makeargs" $(LANGUAGE_TARGET) \
  376.             ||  exit 1; \
  377.         )  ||  exit 1; \
  378.         LANGUAGES=`echo "$$LANGUAGES" \
  379.           | sed 's/[^{]*{[^}]*}[^{]*\(.*\)$$/\1/'`; \
  380.         case "$$LANGUAGES" in \
  381.             ''|*{*}*) \
  382.             ;; \
  383.             *) \
  384.             echo "Bad language specification: '$$LANGUAGES'" \
  385.               1>&2; \
  386.             exit 2 \
  387.             ;; \
  388.         esac; \
  389.         done; \
  390.         exit 0
  391.         
  392. buildhash: config.sh buildhash.o hash.o makedent.o parse.o
  393.     @. ./config.sh; \
  394.       set -x; \
  395.       $$CC $$CFLAGS -o buildhash buildhash.o hash.o makedent.o parse.o \
  396.         $$LIBES
  397.  
  398. icombine: config.sh icombine.o makedent.o parse.o
  399.     . ./config.sh; \
  400.       set -x; \
  401.       $$CC $$CFLAGS -o icombine icombine.o makedent.o parse.o \
  402.         $$LIBES
  403.  
  404. ijoin: config.sh ijoin.o fields.o
  405.     @. ./config.sh; \
  406.       set -x; \
  407.       $$CC $$CFLAGS -o ijoin ijoin.o fields.o $$LIBES
  408.  
  409. EDITFILE    =    notthere
  410. OUTFILE        =    /dev/null
  411.  
  412. config.sh:  config.X local.h
  413.     set $(SHELLDEBUG); \
  414.     for var in BINDIR CC CFLAGS COUNTSUFFIX DEFDICT DEFHASH DEFLANG \
  415.       ELISPDIR EMACS HASHSUFFIX INSTALL \
  416.       LANGUAGES LIBDIR LIBES LINT LINTFLAGS \
  417.       MAKE_SORTTMP MAN1DIR MAN1EXT MAN4DIR MAN4EXT MASTERHASH \
  418.       MSGLANG REGLIB STATSUFFIX \
  419.       TERMLIB TEXINFODIR YACC \
  420.       ; do \
  421.         cat config.X local.h \
  422.           | sed -n -e "s/^#define[     ]*$$var[     ]*"'"'"/$$var=/p" \
  423.           | sed -e 's/".*$$/'"'/" -e "s/=/='/" \
  424.           | tail -1; \
  425.       done > config.sh; \
  426.     echo 'case "$$MAKE_SORTTMP" in "") \
  427.       SORTTMP="-e /!!SORTTMP!!/s/=.*$$/=/";; *) SORTTMP=;; esac' \
  428.       >> config.sh
  429.  
  430. doedit:
  431.     . ./config.sh; \
  432.       sed -e "s@!!LIBDIR!!@$$LIBDIR@" -e "s@!!DEFDICT!!@$$DEFDICT@" \
  433.         -e "s@!!DEFHASH!!@$$DEFHASH@" -e "s@!!DEFLANG!!@$$DEFLANG@" \
  434.         -e "s@!!COUNTSUFFIX!!@$$COUNTSUFFIX@g" \
  435.         -e "s@!!HASHSUFFIX!!@$$HASHSUFFIX@g" \
  436.         -e "s@!!STATSUFFIX!!@$$STATSUFFIX@g" \
  437.         $$SORTTMP < $(EDITFILE) > $(OUTFILE)
  438.  
  439. findaffix:    findaffix.X config.sh
  440.     @$(MAKE) EDITFILE=findaffix.X OUTFILE=findaffix doedit
  441.     chmod +x findaffix
  442.  
  443. ispell.1:    ispell.1X config.sh
  444.     @$(MAKE) EDITFILE=ispell.1X OUTFILE=ispell.1 SHELLDEBUG=$(SHELLDEBUG) \
  445.       doedit
  446.  
  447. munchlist:    munchlist.X config.sh
  448.     @$(MAKE) EDITFILE=munchlist.X OUTFILE=munchlist \
  449.       SHELLDEBUG=$(SHELLDEBUG) doedit
  450.     chmod +x munchlist
  451.  
  452. subset:    subset.X config.sh
  453.     @$(MAKE) EDITFILE=subset.X OUTFILE=subset SHELLDEBUG=$(SHELLDEBUG) \
  454.       doedit
  455.     chmod +x subset
  456.  
  457. tryaffix:    tryaffix.X config.sh
  458.     @$(MAKE) EDITFILE=tryaffix.X OUTFILE=tryaffix \
  459.       SHELLDEBUG=$(SHELLDEBUG) doedit
  460.     chmod +x tryaffix
  461.  
  462. zapdups:    zapdups.X config.sh
  463.     @$(MAKE) EDITFILE=zapdups.X OUTFILE=zapdups SHELLDEBUG=$(SHELLDEBUG) \
  464.       doedit
  465.     chmod +x zapdups
  466.  
  467. OBJS    =    term.o ispell.o correct.o defmt.o dump.o good.o lookup.o \
  468.         hash.o makedent.o tgood.o tree.o xgets.o
  469.  
  470. ispell: config.sh $(OBJS)
  471.     @. ./config.sh; \
  472.       set -x; \
  473.       $$CC $$CFLAGS -o ispell $(OBJS) $$TERMLIB $$REGLIB $$LIBES
  474.  
  475. #    Since some makes don't have appropriate built-in rules, here are
  476. #    dependencies for sq and unsq.  Sigh.
  477. sq:    config.sh msgs.h sq.c
  478.     @. ./config.sh; \
  479.       set -x; \
  480.       $$CC $$CFLAGS -o sq sq.c
  481.  
  482. unsq:    config.sh msgs.h unsq.c
  483.     @. ./config.sh; \
  484.       set -x; \
  485.       $$CC $$CFLAGS -o unsq unsq.c
  486.  
  487. $(OBJS) buildhash.o icombine.o hash.o parse.o: config.h ispell.h local.h
  488. $(OBJS) buildhash.o icombine.o hash.o parse.o: proto.h msgs.h
  489. ijoin.o: config.h ispell.h local.h
  490. ijoin.o: proto.h fields.h
  491. buildhash.o correct.o ispell.o: version.h
  492.  
  493. config.h:    config.X local.h
  494.     cp config.X config.h
  495.     chmod u+w config.h
  496.     echo '' >> config.h
  497.     echo '/* AUTOMATICALLY-GENERATED SYMBOLS */' >> config.h
  498.     cat local.h config.X \
  499.       | egrep '^#define[     ]*SIGNAL_TYPE' \
  500.       | sed -e 's/TYPE[     ]*/TYPE_STRING "/' -e 's/$$/"/' -e 1q \
  501.       >> config.h
  502.     cat local.h config.X \
  503.       | egrep '^#define[     ]*MASKTYPE' \
  504.       | sed -e 's/TYPE[     ]*/TYPE_STRING "/' -e 's/$$/"/' -e 1q \
  505.       >> config.h
  506.  
  507. #    Create a sample local.h if no such file currently exists
  508. local.h:
  509.     set +e; [ -r local.h ]  ||  cp local.h.samp local.h
  510.  
  511. msgs.h:    config.sh FRC
  512.     @. ./config.sh; \
  513.       set $(SHELLDEBUG); \
  514.       set +e; \
  515.       if [ -r languages/$$MSGLANG/msgs.h ]; then \
  516.         msgs=languages/$$MSGLANG/msgs.h; \
  517.       else \
  518.         msgs=languages/english/msgs.h; \
  519.       fi; \
  520.       if cmp -s msgs.h $$msgs; then \
  521.         :; \
  522.       else \
  523.         set -x; \
  524.         rm -f msgs.h; ln $$msgs msgs.h  ||  cp $$msgs msgs.h; \
  525.       fi
  526.  
  527. FRC:
  528.  
  529. tags:    config.h *.[chy]
  530.     ctags -w -t *.[chy]
  531.     sed -e s/config.h/config.X/ tags > ntags
  532.     mv ntags tags
  533.  
  534. TAGS:    config.h *.[chy]
  535.     etags *.[chy]
  536.     sed -e s/config.h/config.X/ TAGS > NTAGS
  537.     mv NTAGS TAGS
  538.  
  539. lint:    languages/*/msgs.h
  540. lint:    config.sh config.h ispell.h proto.h *.[cy]
  541.     @. ./config.sh; \
  542.       $$LINT $$LINTFLAGS ispell.c correct.c defmt.c dump.c good.c \
  543.         hash.c lookup.c makedent.c tgood.c term.c tree.c xgets.c; \
  544.       $$YACC parse.y; \
  545.       $$LINT $$LINTFLAGS buildhash.c hash.c makedent.c y.tab.c; \
  546.       $$LINT $$LINTFLAGS icombine.c makedent.c y.tab.c; \
  547.       $$LINT $$LINTFLAGS ijoin.c fields.c
  548.     @rm -f y.tab.c
  549.  
  550. clean:    config.sh clean-languages
  551.     @. ./config.sh; \
  552.       set -x; \
  553.       rm -f $$DEFHASH $$FOREIGNHASHES
  554.     rm -f *.o core a.out mon.out hash.out y.tab.c *.stat *.cnt \
  555.         config.h msgs.h
  556.     rm -f buildhash findaffix tryaffix ispell icombine ijoin \
  557.         munchlist subset sq unsq zapdups ispell.1 ispell.info
  558.  
  559. clean-languages:
  560.     $(MAKE) LANGUAGE_TARGET=clean SHELLDEBUG=$(SHELLDEBUG) language-subdirs
  561.  
  562. realclean veryclean:    clean dictclean
  563.     rm -f config.sh
  564.  
  565. #
  566. #    The following dependency can be executed when ispell is unpacked,
  567. #    to unpack the dictionaries.
  568. #
  569. unpack:    unsq
  570.     $(MAKE) LANGUAGE_TARGET=unpack SHELLDEBUG=$(SHELLDEBUG) \
  571.       language-subdirs
  572.  
  573. unpacked:
  574.     $(MAKE) SHELLDEBUG=$(SHELLDEBUG) unpack
  575.     touch unpacked
  576.  
  577. #
  578. #    The following target allows you to clean out the leftover raw
  579. #    files gotten from unpacking the kit.  It makes sure that you
  580. #    have the combined files first, so it may take a little while
  581. #    to run.
  582. #
  583. kitclean:    unsq
  584.     $(MAKE) LANGUAGE_TARGET=kitclean SHELLDEBUG=$(SHELLDEBUG) \
  585.       language-subdirs
  586.  
  587. #
  588. #    The following target allows you to clean out the combined
  589. #    dictionary files.  For safety, so you don't lose your files,
  590. #    it makes sure that there is something to work from, but it can
  591. #    only be so smart, so be careful!
  592. #
  593. dictclean:
  594.     $(MAKE) LANGUAGE_TARGET=dictclean SHELLDEBUG=$(SHELLDEBUG) \
  595.       language-subdirs
  596.